#coding:utf-8

import sys, urllib
from django_jinja import library


lib = library.Library()


@lib.filter
def encode(text):
    return urllib.quote(text.decode(sys.stdin.encoding).encode('utf8'))